import glob

import XTestRunner
from HTMLTestRunner_PY3 import HTMLTestRunner
from XTestRunner import HTMLTestRunner
import yagmail
class Tools():
    def report(self):
        report = XTestRunner.HTMLTestRunner(open('./Report/report.html','wb'),title='测试报告',description='今日测试报告')
        return report
    def sendemail(self):
        file = glob.glob('./Report/report.html')
        email =yagmail.SMTP(user='3315608326@qq.com',password='hjvhfyfvztaxchei',host='smtp.qq.com')
        email.send(to='3315608326@qq.com',attachments=file,contents='今日测试')
        email.close()